Skip to content

fix(http,core): write tokens.json and state.json owner-only (#258) - #640

Merged
V3RON merged 3 commits into
mainfrom
bug/258
Oct 16, 2026
Merged

V3RON merged 3 commits into
mainfrom
bug/258

Conversation

@V3RON

@V3RON V3RON commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes #258

Status

Ready for the gate. Both regression tests probed (fail at 0o644).

  • tokens.json is written owner-only (0o600) — src/http/token-store.ts:147, pinned by src/http/token-store.test.ts
  • state.json is written owner-only (0o600) — src/core/registry.ts:950, pinned by src/core/registry.test.ts
  • The false comments are corrected — src/gateway/drain-store.ts:16 is scoped to the files it lists (daemon.log, events.jsonl, instance.json stay 0644); src/daemon/admin-secret.ts:3-5 needed no change: its claim is true once both files are 0600

Existing 0644 files are re-tightened on their next write, as config.json was after #266; no migration.

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 1 note.
Rounds: 1. Tokens: 0.3M.

Written by an agent.

@V3RON

V3RON commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • claims: src/core/registry.test.ts:200 Both new test titles cite "the daemon's local-state guarantee", but no doc states one; only a comment in admin-secret.ts:3-7 mentions "local state" consistency.

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review October 16, 2026 18:01
@V3RON
V3RON merged commit 084657f into main Oct 16, 2026
63 checks passed
@V3RON
V3RON deleted the bug/258 branch October 16, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Comments in admin-secret.ts and drain-store.ts say tokens.json, state.json and config.json are owner-only; they are written 0644

1 participant